﻿using System;

class ValueNumberPosition
{
    static void Main()
    {
        Console.WriteLine("Enter a number:");
        int Number = int.Parse(Console.ReadLine());
        Console.WriteLine("Enter a position of bit:");
        int Position = int.Parse(Console.ReadLine());
        Console.WriteLine("Enter value of bit (0 or 1):");
        int BitValue = int.Parse(Console.ReadLine());
        int mask = 1 << Position;
        int BitMask = ((mask & Number) != 0 ? 1 : 0);
        if (BitMask == 1)
        {
            Console.WriteLine(Number & ~(1 << Position));
        }
        else
        {
            Console.WriteLine(Number | (1 << Position));
        }
    }
}

